package poker.entities;

import java.util.ArrayList;

import poker.util.ConstantCardStrings;


public class Deck {
	
	protected static Deck deck;
	private ArrayList<Card> deckCards;
	
	private Deck(){
		refillDeck();
	}
	
	public void refillDeck(){
		deckCards = new ArrayList<Card>();
		deckCards.removeAll(deckCards);
		Symbol cSymbol = new Symbol(ConstantCardStrings.CLUBS_SYMBOL);
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.TWO)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.THREE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.FOUR)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.FIVE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.SIX)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.SEVEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.EIGHT)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.NINE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.TEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.JACK)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.QUEEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.KING)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.ACE)));
		
		cSymbol = new Symbol(ConstantCardStrings.DIAMONDS_SYMBOL);
		
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.TWO)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.THREE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.FOUR)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.FIVE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.SIX)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.SEVEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.EIGHT)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.NINE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.TEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.JACK)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.QUEEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.KING)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.ACE)));
		
		cSymbol = new Symbol(ConstantCardStrings.HEARTS_SYMBOL);
		
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.TWO)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.THREE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.FOUR)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.FIVE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.SIX)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.SEVEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.EIGHT)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.NINE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.TEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.JACK)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.QUEEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.KING)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.ACE)));
		
		cSymbol = new Symbol(ConstantCardStrings.SPADES_SYMBOL);
		
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.TWO)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.THREE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.FOUR)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.FIVE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.SIX)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.SEVEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.EIGHT)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.NINE)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.TEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.JACK)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.QUEEN)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.KING)));
		deckCards.add(new Card(cSymbol,new Force(ConstantCardStrings.ACE)));
	}
	
	public static Deck getInstance(){
		return deck != null?deck:new Deck();
	}
	
	public ArrayList<Card> getDeckCards(){
		return deckCards;
	}

}
